package interceptor;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;

public class LogInterceptor extends MethodFilterInterceptor{
	private String name;

	public void setName(String name) {
		this.name = name;
	}

	@Override
	protected String doIntercept(ActionInvocation invocation) throws Exception {
		invocation.getAction();
		invocation.getResult();
		System.out.println(name+"_________拦截器业务方法执行前_________");
		String resultCode=invocation.invoke();//调用后续拦截器或者Action对象，相当于doFilter方法
		System.out.println(name+"_________拦截器业务方法执行后_________");
		return resultCode;
	}

}
